﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;

/// <summary>
/// InPatientInfo 的摘要说明
/// </summary>

[DataContract(IsReference = true)]
[KnownType(typeof(InPatientInfo))]
public class InPatientInfo : IComparer
{
    private int _id;
    private string _patient_Name;
    private string _name_Pinyin;
    private string _gender_Code;
    private string _birthday;
    private string _marrige_State;
    private string _bloodtype_ABO;
    private float _height;
    private float _weight;
    private string _pId;
    private string _religion;
    private string _country;
    private string _culture_level;
    private string _natiye_place;
    private string birth_place;
    private string folk_code;
    private string _career;
    private string _position;
    private string _cer_type;
    private string _medicare_no;
    private string _home_address;
    private string _homePostal_code;
    private string _home_phone;
    private string _office;
    private string _office_address;
    private string _office_phone;
    private string _relation_name;
    private string _relation;
    private string _relation_address;
    private string _relation_phone;
    private string _relationPos_code;
    private string _create_time;
    private string _officePos_code;
    private string _age;
    private string _age_unit;
    private int _inHospital_count;
    private string _bloodtype_Rh;
    private float _total_Fee;
    private string _cert_Id;
    private string _state;
    private string _patient_Id;
    private int _patient_Mr;
    private int _section_Id;
    private string _section_Name;
    private int _insection_Id;
    private string _insection_Name;
    private string _in_Doctor_Id;
    private string _in_Doctor_Name;
    private string _sick_Doctor_Id;
    private string _sick_Doctor_Name;
    private string _user_Id;
    private int _in_Area_Id;
    private string _in_Area_Name;
    private int sike_Area_Id;
    private string _sick_Area_Name;
    private int _in_Room_Id;
    private string _in_Room_Name;
    private int _sick_Room_Id;
    private string _sick_Room_Name;
    private int _sick_Group_Id;
    private string _sick_Group_Name;
    private int _in_Treatgroup_Id;
    private string _in_Treatgroup_Name;
    private int _sick_Bed_Id;
    private string _sick_Bed_Name;
    private int _in_Bed_Id;
    private string _in_Bed_Name;
    private float _pre_Pay;
    private string _nurse_Level;
    private DateTime _in_Time;
    private string _reg_In_Time;
    private string _sick_Degree;
    private string _inhospital_Id;
    private string _from_Hospital;
    private string _fee_Type;
    private string _assist_Check;
    private string _leave_Time;
    private string _pay_Manager;
    private int _real_Indays;
    private string _out_Id;
    private string _out_Mrid;
    private string _mrrecord_Time;
    private string _intime_Real;
    private string _document_State;
    private string _in_Approach;
    private string _in_Circs;
    private string _in_Sec_Approach;
    private string _is_Create_Index;
    private string _leavetime_Real;
    private string _Relater_Mr;
    private string _relianstate;
    private string _action_State;
    private int _die_flag;
    private string _card_Id;
    private DateTime _die_time;

    private bool _IsHaveRight;

    private char _IsChangeSection;

    private string _path_state;

    private string his_id;
    private string now_address;
    private string now_addres_postno;
    private string now_addres_phone;
    private string health_card_no;
    private string bornweight;
    private string inweight;
    private string property_flag;
    private string career_other;
    private string sick_doc_no;


    private string patientState;

    private string child_age;

    private string exe_document_time;




    public InPatientInfo() { }

    //public InPatientInfo(int id, string patient_Name, string name_Pinyin, string gender_Code,
    //    string birthday,string marrige_State,string bloodtype_ABO,float height,float weight,
    //    string pId, string religion, string country, string culture_level,string natiye_place,
    //    string birth_place, string folk_code, string career, string position, string cer_type,
    //    string medicare_no, string home_address, string homePostal_code, string home_phone, string office,
    //    string office_address,string )
    //{

    //}

    public InPatientInfo(int id, string patient_Name, string gender_Code, string birthday, string pId, string age, string action_State, string age_Unit, string sick_Danger, string nurse_Leavel)
    {
        this.Id = id;
        this.Patient_Name = patient_Name;
        this.Gender_Code = gender_Code;
        this.Birthday = birthday;
        this.PId = pId;
        this.Age = age;
        this.Action_State = action_State;
        this.Age_unit = age_Unit;
        this.Sick_Degree = sick_Danger;
        this.Nurse_Level = nurse_Leavel;
    }

    [DataMember]
    public string Action_State
    {
        get { return _action_State; }
        set { _action_State = value; }
    }

    [DataMember]
    public string Relianstate
    {
        get { return _relianstate; }
        set { _relianstate = value; }
    }

    [DataMember]
    public string Relater_Mr
    {
        get { return _Relater_Mr; }
        set { _Relater_Mr = value; }
    }
    public string Leavetime_Real
    {
        get { return _leavetime_Real; }
        set { _leavetime_Real = value; }
    }

    [DataMember]
    public string Is_Create_Index
    {
        get { return _is_Create_Index; }
        set { _is_Create_Index = value; }
    }

    [DataMember]
    public string In_Sec_Approach
    {
        get { return _in_Sec_Approach; }
        set { _in_Sec_Approach = value; }
    }

    [DataMember]
    public string In_Circs
    {
        get { return _in_Circs; }
        set { _in_Circs = value; }
    }

    [DataMember]
    public string In_Approach
    {
        get { return _in_Approach; }
        set { _in_Approach = value; }
    }

    [DataMember]
    public string Document_State
    {
        get { return _document_State; }
        set { _document_State = value; }
    }
    [DataMember]
    public string Intime_Real
    {
        get { return _intime_Real; }
        set { _intime_Real = value; }
    }
    [DataMember]
    public string Mrrecord_Time
    {
        get { return _mrrecord_Time; }
        set { _mrrecord_Time = value; }
    }
    [DataMember]
    public string Out_Mrid
    {
        get { return _out_Mrid; }
        set { _out_Mrid = value; }
    }
    [DataMember]
    public string Out_Id
    {
        get { return _out_Id; }
        set { _out_Id = value; }
    }
    [DataMember]
    public int Real_Indays
    {
        get { return _real_Indays; }
        set { _real_Indays = value; }
    }
    [DataMember]
    public string Pay_Manager
    {
        get { return _pay_Manager; }
        set { _pay_Manager = value; }
    }
    public string Leave_Time
    {
        get { return _leave_Time; }
        set { _leave_Time = value; }
    }
    [DataMember]
    public string Assist_Check
    {
        get { return _assist_Check; }
        set { _assist_Check = value; }
    }
    [DataMember]
    public string Fee_Type
    {
        get { return _fee_Type; }
        set { _fee_Type = value; }
    }
    [DataMember]
    public string From_Hospital
    {
        get { return _from_Hospital; }
        set { _from_Hospital = value; }
    }
    [DataMember]
    public string Inhospital_Id
    {
        get { return _inhospital_Id; }
        set { _inhospital_Id = value; }
    }
    [DataMember]
    public string Sick_Degree
    {
        get { return _sick_Degree; }
        set { _sick_Degree = value; }
    }
    [DataMember]
    public string Reg_In_Time
    {
        get { return _reg_In_Time; }
        set { _reg_In_Time = value; }
    }
    [DataMember]
    public DateTime In_Time
    {
        get { return _in_Time; }
        set { _in_Time = value; }
    }
    [DataMember]
    public string Nurse_Level
    {
        get { return _nurse_Level; }
        set { _nurse_Level = value; }
    }
    [DataMember]
    public float Pre_Pay
    {
        get { return _pre_Pay; }
        set { _pre_Pay = value; }
    }
    [DataMember]
    public string In_Bed_Name
    {
        get { return _in_Bed_Name; }
        set { _in_Bed_Name = value; }
    }
    [DataMember]
    public int In_Bed_Id
    {
        get { return _in_Bed_Id; }
        set { _in_Bed_Id = value; }
    }
    [DataMember]
    public string Sick_Bed_Name
    {
        get { return _sick_Bed_Name; }
        set { _sick_Bed_Name = value; }
    }
    [DataMember]
    public int Sick_Bed_Id
    {
        get { return _sick_Bed_Id; }
        set { _sick_Bed_Id = value; }
    }
    [DataMember]
    public string In_Treatgroup_Name
    {
        get { return _in_Treatgroup_Name; }
        set { _in_Treatgroup_Name = value; }
    }
    [DataMember]
    public int In_Treatgroup_Id
    {
        get { return _in_Treatgroup_Id; }
        set { _in_Treatgroup_Id = value; }
    }
    [DataMember]
    public string Sick_Group_Name
    {
        get { return _sick_Group_Name; }
        set { _sick_Group_Name = value; }
    }
    [DataMember]
    public int Sick_Group_Id
    {
        get { return _sick_Group_Id; }
        set { _sick_Group_Id = value; }
    }
    [DataMember]
    public string Sick_Room_Name
    {
        get { return _sick_Room_Name; }
        set { _sick_Room_Name = value; }
    }
    [DataMember]
    public int Sick_Room_Id
    {
        get { return _sick_Room_Id; }
        set { _sick_Room_Id = value; }
    }
    [DataMember]
    public string In_Room_Name
    {
        get { return _in_Room_Name; }
        set { _in_Room_Name = value; }
    }
    [DataMember]
    public int In_Room_Id
    {
        get { return _in_Room_Id; }
        set { _in_Room_Id = value; }
    }
    [DataMember]
    public string Sick_Area_Name
    {
        get { return _sick_Area_Name; }
        set { _sick_Area_Name = value; }
    }
    [DataMember]
    public int Sike_Area_Id
    {
        get { return sike_Area_Id; }
        set { sike_Area_Id = value; }
    }
    [DataMember]
    public string In_Area_Name
    {
        get { return _in_Area_Name; }
        set { _in_Area_Name = value; }
    }
    [DataMember]
    public int In_Area_Id
    {
        get { return _in_Area_Id; }
        set { _in_Area_Id = value; }
    }
    [DataMember]
    public string User_Id
    {
        get { return _user_Id; }
        set { _user_Id = value; }
    }
    [DataMember]
    public string Sick_Doctor_Name
    {
        get { return _sick_Doctor_Name; }
        set { _sick_Doctor_Name = value; }
    }
    [DataMember]
    public string Sick_Doctor_Id
    {
        get { return _sick_Doctor_Id; }
        set { _sick_Doctor_Id = value; }
    }
    [DataMember]
    public string In_Doctor_Name
    {
        get { return _in_Doctor_Name; }
        set { _in_Doctor_Name = value; }
    }

    [DataMember]
    public string In_Doctor_Id
    {
        get { return _in_Doctor_Id; }
        set { _in_Doctor_Id = value; }
    }
    [DataMember]
    public string Insection_Name
    {
        get { return _insection_Name; }
        set { _insection_Name = value; }
    }
    [DataMember]
    public int Insection_Id
    {
        get { return _insection_Id; }
        set { _insection_Id = value; }
    }
    [DataMember]
    public string Section_Name
    {
        get { return _section_Name; }
        set { _section_Name = value; }
    }
    [DataMember]
    public int Section_Id
    {
        get { return _section_Id; }
        set { _section_Id = value; }
    }
    [DataMember]
    public int Patient_Mr
    {
        get { return _patient_Mr; }
        set { _patient_Mr = value; }
    }
    [DataMember]
    public string Patient_Id
    {
        get { return _patient_Id; }
        set { _patient_Id = value; }
    }
    [DataMember]
    public string State
    {
        get { return _state; }
        set { _state = value; }
    }
    [DataMember]
    public string Cert_Id
    {
        get { return _cert_Id; }
        set { _cert_Id = value; }
    }
    [DataMember]
    public float Total_Fee
    {
        get { return _total_Fee; }
        set { _total_Fee = value; }
    }
    [DataMember]
    public string Bloodtype_Rh
    {
        get { return _bloodtype_Rh; }
        set { _bloodtype_Rh = value; }
    }
    [DataMember]
    public int InHospital_count
    {
        get { return _inHospital_count; }
        set { _inHospital_count = value; }
    }
    [DataMember]

    public string Age_unit
    {
        get { return _age_unit; }
        set { _age_unit = value; }
    }
    [DataMember]
    public string Age
    {
        get { return _age; }
        set { _age = value; }
    }
    [DataMember]
    public string OfficePos_code
    {
        get { return _officePos_code; }
        set { _officePos_code = value; }
    }
    [DataMember]
    public string Create_time
    {
        get { return _create_time; }
        set { _create_time = value; }

    }
    [DataMember]
    public string RelationPos_code
    {
        get { return _relationPos_code; }
        set { _relationPos_code = value; }
    }
    public string Relation_phone
    {
        get { return _relation_phone; }
        set { _relation_phone = value; }
    }
    [DataMember]
    public string Relation_address
    {
        get { return _relation_address; }
        set { _relation_address = value; }
    }
    [DataMember]
    public string Relation
    {
        get { return _relation; }
        set { _relation = value; }
    }
    [DataMember]
    public string Relation_name
    {
        get { return _relation_name; }
        set { _relation_name = value; }
    }
    [DataMember]
    public string Office_phone
    {
        get { return _office_phone; }
        set { _office_phone = value; }
    }
    [DataMember]
    public string Office_address
    {
        get { return _office_address; }
        set { _office_address = value; }
    }
    [DataMember]
    public string Office
    {
        get { return _office; }
        set { _office = value; }
    }
    [DataMember]
    public string Home_phone
    {
        get { return _home_phone; }
        set { _home_phone = value; }
    }
    [DataMember]
    public string HomePostal_code
    {
        get { return _homePostal_code; }
        set { _homePostal_code = value; }
    }
    [DataMember]
    public string Home_address
    {
        get { return _home_address; }
        set { _home_address = value; }
    }
    [DataMember]
    public string Medicare_no
    {
        get { return _medicare_no; }
        set { _medicare_no = value; }
    }
    [DataMember]
    public string Cer_type
    {
        get { return _cer_type; }
        set { _cer_type = value; }
    }
    [DataMember]

    public string Position
    {
        get { return _position; }
        set { _position = value; }
    }
    [DataMember]
    public string Career
    {
        get { return _career; }
        set { _career = value; }
    }
    [DataMember]

    public string Folk_code
    {
        get { return folk_code; }
        set { folk_code = value; }
    }
    [DataMember]

    public string Birth_place
    {
        get { return birth_place; }
        set { birth_place = value; }
    }
    [DataMember]
    public string Natiye_place
    {
        get { return _natiye_place; }
        set { _natiye_place = value; }
    }
    [DataMember]
    public string Culture_level
    {
        get { return _culture_level; }
        set { _culture_level = value; }
    }
    [DataMember]
    public string Country
    {
        get { return _country; }
        set { _country = value; }
    }
    [DataMember]
    public string Religion
    {
        get { return _religion; }
        set { _religion = value; }
    }
    [DataMember]
    public string PId
    {
        get { return _pId; }
        set { _pId = value; }
    }
    [DataMember]
    public float Weight
    {
        get { return _weight; }
        set { _weight = value; }
    }
    [DataMember]
    public float Height
    {
        get { return _height; }
        set { _height = value; }
    }
    [DataMember]
    public string Bloodtype_ABO
    {
        get { return _bloodtype_ABO; }
        set { _bloodtype_ABO = value; }
    }
    [DataMember]
    public string Marrige_State
    {
        get { return _marrige_State; }
        set { _marrige_State = value; }
    }
    [DataMember]
    public string Birthday
    {
        get { return _birthday; }
        set { _birthday = value; }
    }
    [DataMember]
    public string Gender_Code
    {
        get { return _gender_Code; }
        set { _gender_Code = value; }
    }
    [DataMember]
    public string Name_Pinyin
    {
        get { return _name_Pinyin; }
        set { _name_Pinyin = value; }
    }
    [DataMember]

    public string Patient_Name
    {
        get { return _patient_Name; }
        set { _patient_Name = value; }
    }
    [DataMember]
    public int Id
    {
        get { return _id; }
        set { _id = value; }
    }
    [DataMember]

    public int Die_flag
    {
        get { return _die_flag; }
        set { _die_flag = value; }
    }
    [DataMember]

    public string Card_Id
    {
        get { return _card_Id; }
        set { _card_Id = value; }
    }
    [DataMember]

    public DateTime Die_time
    {
        get { return _die_time; }
        set { _die_time = value; }
    }

    /// <summary>
    /// 是否被授权
    /// </summary>
    [DataMember]
    public bool IsHaveRight
    {
        get { return _IsHaveRight; }
        set { _IsHaveRight = value; }
    }

    /// <summary>
    /// 是否转科
    /// </summary>
    [DataMember]
    public char IsChangeSection
    {
        get { return _IsChangeSection; }
        set { _IsChangeSection = value; }
    }

    /// <summary>
    /// 临床路径状态
    /// </summary>
    [DataMember]
    public string Path_state
    {
        get { return _path_state; }
        set { _path_state = value; }
    }

    /// <summary>
    /// 记录HIS的主键
    /// </summary>
    [DataMember]
    public string His_id
    {
        get { return his_id; }
        set { his_id = value; }
    }

    /// <summary>
    /// 现住地址
    /// </summary>
    [DataMember]
    public string Now_address
    {
        get { return now_address; }
        set { now_address = value; }
    }

    /// <summary>
    /// 现住地址邮编
    /// </summary>
    [DataMember]
    public string Now_addres_postno
    {
        get { return now_addres_postno; }
        set { now_addres_postno = value; }
    }

    /// <summary>
    ///现住地址电话 
    /// </summary>
    [DataMember]
    public string Now_addres_phone
    {
        get { return now_addres_phone; }
        set { now_addres_phone = value; }
    }

    /// <summary>
    /// 健康卡号
    /// </summary>
    [DataMember]
    public string Health_card_no
    {
        get { return health_card_no; }
        set { health_card_no = value; }
    }


    /// <summary>
    /// 新生儿出生体重
    /// </summary>
    [DataMember]
    public string Bornweight
    {
        get { return bornweight; }
        set { bornweight = value; }
    }
    /// <summary>
    /// 新生儿入院体重
    /// </summary>
    [DataMember]
    public string Inweight
    {
        get { return inweight; }
        set { inweight = value; }
    }

    /// <summary>
    /// 病人性质标志 1, 2
    /// </summary>
    [DataMember]
    public string Property_flag
    {
        get { return property_flag; }
        set { property_flag = value; }
    }

    /// <summary>
    /// 其他职业手填部分
    /// </summary>
    [DataMember]
    public string Career_other
    {
        get { return career_other; }
        set { career_other = value; }
    }

    /// <summary>
    /// 病案号
    /// </summary>
    [DataMember]
    public string Sick_doc_no
    {
        get { return sick_doc_no; }
        set { sick_doc_no = value; }
    }

    /// <summary>
    /// 病人状态：“借阅”，“授权”
    /// 病案借阅和文书授权的病人状态
    /// </summary>
    [DataMember]
    public string PatientState
    {
        get { return patientState; }
        set { patientState = value; }
    }

    /// <summary>
    /// 不满一周岁的儿童年龄
    /// </summary>
    [DataMember]
    public string Child_age
    {
        get { return child_age; }
        set { child_age = value; }
    }
    /// <summary>
    /// 归档时间
    /// </summary>
    [DataMember]
    public string Exe_document_time
    {
        get { return exe_document_time; }
        set { exe_document_time = value; }
    }
    
    private string nornWeight;
    [DataMember]
    public string BornWeight
    {
        get { return nornWeight; }
        set { nornWeight = value; }
    }


    //袁杨添加 150811
    private string _xin_Approach;
    [DataMember]
    public string Xin_Approach
    {
        get { return _xin_Approach; }
        set { _xin_Approach = value; }
    }

    //袁杨添加组织机构代码字段150813
    private string _zzjgdm;
    [DataMember]
    public string ZZJGDM
    {
        get { return _zzjgdm; }
        set { _zzjgdm = value; }
    }

    //责任护士   20151027 kkc
    private string zrhs;
    [DataMember]
    public string ZRHS
    {
        get { return zrhs; }
        set { zrhs = value; }
    }

    private string zrhsName;
    [DataMember]
    public string ZRHSNAME
    {
        get { return zrhsName; }
        set { zrhsName = value; }
    }

    #region IComparer 成员
    public int Compare(object x, object y)
    {
        try
        {
            InPatientInfo inpatient1 = x as InPatientInfo;
            InPatientInfo inpatient2 = y as InPatientInfo;
            string bed_No1 = inpatient1.Sick_Bed_Name;
            string bed_No2 = inpatient2.Sick_Bed_Name;
            int count = 0;
            for (int i = 0; i < bed_No1.Length; i++)
            {
                char a = bed_No1[i];
                char b = bed_No2[i];
                count = a.CompareTo(b);
                if (count > 0 || count < 0)
                {
                    break;
                }
            }
            return count;
        }
        catch
        {
            return 0;
        }
    }
    #endregion
}
